package net.vkits.admin.application;

import net.vkits.admin.domain.model.Syslog;
import net.vkits.admin.domain.repository.SyslogRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by ethan-liu on 16/4/13.
 */
@Service
public class SyslogApplicationService {
    private static final Logger logger = LoggerFactory.getLogger(SyslogApplicationService.class);

    @Resource
    private SyslogRepository syslogRepository;

    public void insertLog(Syslog syslog) {
        syslogRepository.save(syslog);
    }

    public Page<Syslog> getSyslogs(Pageable pageable) {
        return syslogRepository.findAll(pageable);
    }
}
